from django.urls import path
# from rest_framework_jwt.views import obtain_jwt_token
from apps.meiduo_admin.user import meiduo_token
from apps.meiduo_admin.views import home, user, images, sku, permission,group,manager
from apps.meiduo_admin.views.group import GroupModelViewSet
from apps.meiduo_admin.views.manager import ManagerModelViewSet
from apps.meiduo_admin.views.permission import PermissionModelViewSet
from apps.meiduo_admin.views.sku import SkuModelViewSet

urlpatterns=[
    path('authorizations/',meiduo_token),
    path('statistical/day_active/',home.DailyActiveAPIView.as_view()),
    path('statistical/day_orders/',home.DailyOrderCountAPIView.as_view()),
    path('users/',user.UserAPIView.as_view()),
    path('skus/simple/',images.ImageListAPIView.as_view()),
    path('skus/categories/',sku.SkuCategories.as_view()),
    path('goods/simple/',sku.Spu.as_view()),
    path('goods/<spu_id>/specs/',sku.SPUSpecificationAPIView.as_view()),
    path('permission/content_types/',permission.ContentTypeModelViewSet.as_view()),
    path('permission/simple/',group.GetGroup.as_view()),
    path('permission/groups/simple/',manager.GetManagerGroup.as_view()),


]

from rest_framework.routers import DefaultRouter
router=DefaultRouter()
router.register('skus/images',images.ImageModelViewSet,basename='images')
urlpatterns+=router.urls

############sku################
router.register('skus',SkuModelViewSet,basename='skus')
urlpatterns+=router.urls

#############permission###################
router.register('permission/perms',PermissionModelViewSet,basename='perms')
urlpatterns+=router.urls

#############group###################
router.register('permission/groups',GroupModelViewSet,basename='groups')
urlpatterns+=router.urls


#############manager###################
router.register('permission/admins',ManagerModelViewSet,basename='admins')
urlpatterns+=router.urls


